Many team maintained packages in Debian are maintained in
Subversion which
makes a lot of sense if people agreed on a common workflow. If you want to use
git to work on these packages you can still do so with a bit of
configuration without changing anything for the other team members. Let's take
system-config-printer as example.
git-svn can be used to checkout the
svn repository:
git svn clone svn+ssh://svn.debian.org/svn/pkg-gnome/ -T packages/unstable/system-config-printer -t tags/system-config-printer system-config-printer
Since the
pkg-gnome team keeps all the packages in one huge SVN repository and
splits the directories by release first and then by package the above command
uses
-T to point git-svn to system-config-printer's
trunk and
-t to point
it to the
tags directory. In simpler repositories where
trunk,
branches
and
tags are subdirectories of the same base directory using
--stdlayout
instead is enough.
Since in SVN based packaging the upstream sources usually aren't kept in the
repository
git-buildpackage needs to know where to find them and how to
combine things in the build-directory:
cd system-config-printer
cat <<EOF >.git/gbp.conf
[git-buildpackage]
# Build in a separate build-area
export-dir = ../build-area/
# Look for tarballs in ../tarballs
tarball-dir = ../tarballs/
# Overlay the upstream sources on top of it
overlay = True
# Don't use pristine-tar
pristine-tar = False
# Compression type of the tarball
compression = bzip2
Like with
svn-buildpackage the orig-tarball is expected to be found in
../tarballs where you should put it now e.g. using the
get-orig-source
target of
debian/rules (yes, git-buildpackage should support this
implicitly). You can then work on the package as usual using all the nifty
git commands like
git-rebase, etc. and build the package (in this case
using
git-pbuilder):
git-buildpackage --git-pbuilder
or if you don't want to export the current branch's HEAD of your git repository
but your working copy (which might contain uncommitted changes) to the
build-area instead use:
git-buildpackage --git-pbuilder --git-export=WC
The built packages can then be found in
../build-area. Once the package is
ready pushing the changes into the SVN remote repository is as simple as:
git svn dcommit
git svn tag -m"Tagging system-config-printer (1.2.3-0.2)" 1.2.3-0.2
The last command appropriately tags the new version.
This saves a bit of
typing. In order to fetch changes others have made use:
git svn rebase